package com.timeDeal.servlet;








import com.timeDeal.service.JubaoService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;


/**
 * Created by Administrator on 2016/7/24.
 */

public class YIchuliServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String jubaoid = request.getParameter("id");
        String currentpage = request.getParameter("currentpage");
        JubaoService jubaoService =new  JubaoService();
        request.setAttribute("currentpage",currentpage);
        if (jubaoService.JubaoChuli(Integer.valueOf(jubaoid))) {
                request.getRequestDispatcher("/admin/jubaochuligg.jsp?currentpage"+currentpage).forward(request,response);
            } else {
                request.getRequestDispatcher("/admin/jubaochuligg.jsp").forward(request,response);
            }




    }
}
